/**
 * Created by Administrator on 2017/7/10 0010.
 */
//切换标签，显示当前项目的上线详情
$('#deploy-online-tabs').delegate('li', 'click', function () {
    var liself = this;
    var liobj = $(liself).children().eq(0);
    var pro_id = liobj.attr('proid');
    var owner_id = liobj.attr('prowner');
    // console.log(pro_id,owner_id);
    $('#deploy-online-detailtable').children().each(function () {
         var trself = this;
        $(trself).remove()
    });
    //根据项目id和用户id获取对应的项目上线详情
    $.ajax({
        url: '/deploy/onlinedetail/',
        type: 'POST',
        data: {'proid': pro_id, 'prownerid': owner_id},
        success: function (data) {
            var retdata = JSON.parse(data);
            if (retdata.length > 0) {
                for (i = 0; i < retdata.length; i++) {
                    var td1 = "<td>" + retdata[i][0] + "</td>";
                    var td2 = "<td>" + retdata[i][1] + "</td>";
                    var td3 = "<td>" + retdata[i][2] + "</td>";
                    var trtag = document.createElement('tr');
                    $(trtag).append(td1);
                    $(trtag).append(td2);
                    $(trtag).append(td3);
                    $('#deploy-online-detailtable').append(trtag);
                }
            }

        }
    })
});
$("#deploy-online-tabs").find('li').eq(0).click();